package com.joysuch.wwyt.attendant.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * @author xsx
 * @version 1.0
 * @date 2023/2/16 17:45
 */
public enum AttendantStateEnum {

    STAGING(0,"暂存"),

    NOT_STARTED(1,"未开始"),

    HAVE_IN_HAND(2,"进行中"),

    COMPLETED(3,"已完成"),

    OVERDUE(-1,"逾期未完成");

    private Integer value;

    private String desc;

    AttendantStateEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public final Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    private static final Map<Integer, AttendantStateEnum> lookup = new HashMap<>();

    static {
        for (AttendantStateEnum e : EnumSet.allOf(AttendantStateEnum.class)) {
            lookup.put(e.value, e);
        }
    }

    public static AttendantStateEnum find(Integer value) {
        return lookup.get(value);
    }
}
